import React, { Component } from 'react';
import {Route,Redirect} from "react-router-dom"
class PrivateRoute extends Component {
    render() {
        let islogin=sessionStorage.getItem("islogin");//'1' null
        return (
            <>
                {
                    islogin?<Route {...this.props}></Route>:<Redirect to="/login"></Redirect>
                }
            </>
        );
    }
}

export default PrivateRoute;